public class code {
    public static void main(String[] args) {
       int num = 1234;
       print(num);
    }
    public static void print(int n){
        if(n / 10 == 0){
            System.out.println(n);
        }else{
            print(n / 10);
            System.out.println(n % 10);
        }
    }
}
